using UnityEngine;
using UnityEngine.Events;

public class PausePanel : MonoBehaviour
{
	private GameController gameController;

	private Animator animator;

	private UnityAction onEndHideAction;

	public void Awake()
	{
		animator = GetComponent<Animator>();
		gameController = UnityEngine.Object.FindObjectOfType<GameController>();
	}

	public void SetOnEndHideAction(UnityAction onEndHideAction)
	{
		this.onEndHideAction = onEndHideAction;
	}

	public void OnClickContinue()
	{
		AudioController.instance.Play("button");
		animator.SetTrigger("Hide");
	}

	public void OnClickRestart()
	{
		AudioController.instance.Play("button");
		animator.SetTrigger("Hide");
		gameController.OnRestartLevel();
		onEndHideAction = null;
	}

	public void OnClickMenu()
	{
		AudioController.instance.Play("button");
		animator.SetTrigger("Hide");
		gameController.BackToMainMenu(goToCurrentLevel: false);
		onEndHideAction = null;
	}

	public void OnEndHide()
	{
		if (onEndHideAction != null)
		{
			onEndHideAction();
		}
		UnityEngine.Object.Destroy(base.gameObject);
	}

	public void OnEndShow()
	{
	}
}
